#include <iostream>
#include <algorithm>
using namespace std;

typedef long long LL;

const int N = 1e5 + 10; 
const LL P = 1e9 + 7;

int n;
LL a[N];

int main()
{
	cin >> n;
	for(int i = 1; i <= n; i++) cin >> a[i];
	sort(a + 1, a + 1 + n);
	LL ans = 1;
	for(int i = 1; i <= n; i++) ans = (ans * (a[i] / a[1])) % P;
	
	cout << a[1] << " " << ans << endl;
	return 0; 
}
